package com.icatw.club.controller;

import com.icatw.club.domain.ClubPosition;
import com.icatw.club.service.IClubPositionService;
import com.icatw.common.core.controller.BaseController;
import com.icatw.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 职位Controller
 *
 * @author icatw
 * @date 2022-06-10
 */
@RestController
@RequestMapping("/club/position")
@Slf4j
public class ClubPositionController extends BaseController {
    @Autowired
    private IClubPositionService clubPositionService;

    /**
     * 查询职位列表
     */
    @PreAuthorize("@ss.hasPermi('club:position:list')")
    @GetMapping("/list")
    @ApiOperation("查询职位列表")
    public TableDataInfo list() {
        List<ClubPosition> list = clubPositionService.list();
        log.info(list.toString());
        return getDataTable(list);
    }
}
